#ifndef __CORE_SINGLETONMANAGER_HXX__
#define __CORE_SINGLETONMANAGER_HXX__

#include "singletonmanager.h"

#include <boost/static_assert.hpp>
#include <boost/type_traits/is_base_of.hpp>

namespace raytracer {

template<typename SingletonType>
void SingletonManager::m_register_instance(boost::shared_ptr<SingletonType> a_instance)
{
   typedef typename boost::is_base_of<Singleton<SingletonType>,SingletonType>
           MustInheritsFromSingletonClass;
   BOOST_STATIC_ASSERT( MustInheritsFromSingletonClass::value );

   this->push_back(boost::static_pointer_cast<SingletonBase>(a_instance));
}

} //end of namespace

#endif //__CORE_SINGLETONMANAGER_HXX__
